import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.config.productionTip = false

let app = null

const render = () => {
  app = new Vue({
    router,
    render: h => h(App)
  }).$mount('#appv2-container')
}

// 当前环境不是微前端环境
if (!window.__POWERED_BY_QIANKUN__) {
  render()
}

// 开始的声明周期
export const bootstrap = async () => {
  console.log('bootstrap', 'vue2')
}

export const mount = async () => {
  render()
  console.log('mount', 'vue2')
}

export const unmount = async () => {
  console.log('unmount', 'vue2')
}
